package com.qf.service.impl;

import com.qf.entity.MdUnitDTO;
import com.qf.entity.MdUnitMeasure;
import com.qf.mapper.MdUnitMeasureMapper;
import com.qf.service.MdUnitMeasureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ==== 勤能补拙 ====
 *
 * @author dzz
 * @date 2025/4/22
 * <p>
 * ==== 行稳致远 进而有为 ====
 */
@Service
public class MdUnitMeasureServiceImpl implements MdUnitMeasureService {
    @Autowired
    private MdUnitMeasureMapper mdUnitMeasureMapper;


    @Override
    public List<MdUnitMeasure> getUnitMeasureList(MdUnitDTO mdUnitDTO) {
        List<MdUnitMeasure> list = mdUnitMeasureMapper.selectAll(mdUnitDTO);
        return list;
    }

    @Override
    public int addUnitMeasure(MdUnitMeasure mdUnitMeasure) {

        return mdUnitMeasureMapper.insert(mdUnitMeasure);
    }

    @Override
    public int delUnitMeasure(Integer measureId) {
        return mdUnitMeasureMapper.deleteById(measureId);
    }

    @Override
    public int delUnitMeasureBatch(List<Integer> list) {
        return mdUnitMeasureMapper.deleteBatchIds(list);
    }

    @Override
    public int updateUnitMeasure(MdUnitMeasure mdUnitMeasure) {
        return mdUnitMeasureMapper.updateMdUnitMeasure(mdUnitMeasure);
    }
}
